package at.codejedi.sto.controller.lazy;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import at.codejedi.sto.gui.lazy.ILazyView;

public abstract class LazyViewController<TLazyView extends ILazyView> {

	private TLazyView view;

	public LazyViewController() {
		view = createLazyView();
		addListener();

	}

	private void addListener() {
		view.initialLoaded(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				initialLoaded();
			}
		});
	}

	public abstract TLazyView createLazyView();

	public TLazyView getView() {
		return view;
	}

	public abstract void initialLoaded();

}
